<!DOCTYPE html>
<html>
<head>
	<title></title>
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<meta charset="utf-8">
	<link rel="stylesheet" type="text/css" href="../css/top_main.css">
	<link rel="stylesheet" type="text/css" href="../css/layui.css" >
	<link rel="stylesheet" type="text/css" href="../css/style.css">
</head>
<body>
	<div class="top have_bg">
		<a href="#" class="goback">
			<img src="../images/icons/goback1.png" />
		</a>
		<span>钱包充值</span>
	</div>
	<div class="padd_top"></div>
	<form class="pack_form" method="">
		<div class="form_inner inner_border m_flex_box flex_jz flex_vc">
			<span class="form_inner_left">账户充值</span>
			<span class="form_inner_right">18151851890</span>
		</div>
		<div class="form_inner inner_bottom m_flex_box flex_jz flex_vc">
			<span class="form_inner_left">账户余额</span>
			<span class="form_inner_right">0.01</span>
		</div>
		<div class="form_inner inner_bottom m_flex_box flex_jz flex_vc">
			<span class="form_inner_left">充值金额</span>
			<input type="number" class="charge_inp" name="charge" placeholder="请输入充值金额" step="0.01" onkeyup=" bindKeyEvent($(this))">
		</div>
		<div class="form_inner inner_bottom m_flex_box flex_jz flex_vc">
			<span class="form_inner_left">支付方式</span>
			<div class="m_flex_box flex_vc charge_way">
				<img src="../images/my_hy/wx.png">
				<span>微信支付</span>
			</div>
		</div>
		<div class="m_flex_box bottom_form flex_vc flex_hc">
			<button>确认开通</button>
		</div>
	</form>
	<script type="text/javascript" src="../js/model/jquery-2.1.4.min.js"></script>
	<script type="text/javascript" src="../js/model/bootstrap.js"></script>
	<script type="text/javascript" src="../js/layer/layer.js"></script>
	<script type="text/javascript" src="../js/model/reset_font.js"  ></script>
	<script type="text/javascript" src="../layui.all.js"></script>
	<script type="text/javascript">
		$('.charge_inp').bind('input propertychange', function() {
		 if($(this).val() != ""){
				$(".bottom_form button").addClass("active");
			}else{
				$(".bottom_form button").removeClass("active");
			}
		});
		function sub(){
			if($('.charge_inp').val() == ""){
				layer.msg("请输入充值金额");
				return false;
			}else{
				return true;
			}
		};
		
		function bindKeyEvent(obj){  
			    obj.keyup(function () {  
			        var reg = $(this).val().match(/\d+\.?\d{0,2}/);  
			        var txt = '';  
			        if (reg != null) {  
			            txt = reg[0];  
			        }  
			        $(this).val(txt);  
			    }).change(function () {  
			        $(this).keypress();  
			        var v = $(this).val();  
			        if (/\.$/.test(v))  
			        {  
			            $(this).val(v.substr(0, v.length - 1));  
			        }  
			    });  
			}  
		$(".bottom_form").click(function(){
			if(sub()){
				$(".pack_form").submit();
			}else{
				return false;
			}
		})
	</script>
</body>
</html>